/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package readerRSS;

import MVC.IModel;
import java.util.ArrayList;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author thomas
 */
public class RssItemListModel implements ListModel, IModel {

    private ArrayList<RssItemModel> _myItemList;

    /**
     *
     * @param itemList
     */
    public RssItemListModel(ArrayList<RssItemModel> itemList) {
        _myItemList = itemList;
    }

    /**
     *
     * @param obj
     */
    public RssItemListModel(RssItemListModel obj) {
        this._myItemList = obj.getMyItemList();
    }

    @Override
    public int getSize() {
        return getMyItemList().size();
    }

    @Override
    public Object getElementAt(int i) {
        return getMyItemList().get(i);
    }

    @Override
    public void addListDataListener(ListDataListener ll) {
    }

    @Override
    public void removeListDataListener(ListDataListener ll) {
    }

    /**
     * @return the _myItemList
     */
    public ArrayList<RssItemModel> getMyItemList() {
        return _myItemList;
    }

    /**
     * @param myItemList the _myItemList to set
     */
    public void setMyItemList(ArrayList<RssItemModel> myItemList) {
        this._myItemList = myItemList;
    }
}
